
/**
 * 判断token过期时间，判断是否要重新请求
 */
export function getShareData (type = 'app') {
  const shareData = wx.getStorageSync('shareData')
  if (!shareData) {
    return null
  }
  if (type === 'app') {
    return {
      title: shareData.title,
      imageUrl: shareData.thumb,
      path: shareData.url
    }
  } else {
    return {
      title: shareData.title,
      imageUrl: shareData.icon,
      query: shareData.url
    }
  }
}

/**
 * 判断token过期时间，判断是否要重新请求
 */
export function getShareAppMessage () {
  return getShareData('app')
}

/**
 * 判断token过期时间，判断是否要重新请求
 */
export function getShareTimeline () {
  return getShareData('timeline')
}
